# 12 内置方法
# 映射关系
# 可迭代
from http.client import responses

# 1.key()
dict={"key1":12,"key2":"ab"}
print(dict.keys())
# 2.values()
dict={"key1":12,"key2":"ab"}
print(dict.values())
# 3.items()
print(dict.items())
# 4.update()
print(dict.update({"key1":100,"key2":"abcd"}))
# 5.get()
print(dict.get("key3",109))
# 6.setdefault()
print(dict.setdefault("c", 100))
# 7.pop()
print(dict.pop("key2"))
# 8.clear()
print(dict.clear())
# 9.copy()
dict1={"response":"weqeqw","resport":"wqeqrtgdasf"}
dict2=dict1.copy()
print(dict2)
# 10.popitem()
print(dict2.popitem())
# 11.fromkeys()类方法
keys = ['a', 'b', 'c']
new_dict = dict.fromkeys(keys, 0)
print(new_dict)